# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年03月08日
"""
from docx import Document
from docx.shared import Pt, RGBColor
from docx.oxml.ns import qn

doc = Document("test2.docx")
for paragraph in doc.paragraphs:
	for run in paragraph.runs:
		run.font.bold = True
		run.font.italic = True
		run.font.underline = True
		run.font.strike = True
		run.font.shadow = True
		run.font.size = Pt(18)
		run.font.color.rgb = RGBColor(255, 255, 0)
		run.font.name = "宋体"
		# 设置像宋体这样的字体,必须添加下面2行代码
		r = run._element.rPr.rFonts
		r.set(qn("w:eastAsia"), "宋体")

doc.save("test3.docx")
